#include <stdio.h>
#include "../../src/gtthread.h"

char g_str[] = "hello world\n";

void* worker2(void* arg)
{
	printf("worker2 started\n");
	volatile int i;
	for(i=0;i<100000000;i++);
}

void* worker(void* arg)
{
	gtthread_t th;

	printf("worker1 starts\n");

	gtthread_create(&th, worker2, NULL);
	
	gtthread_join(th, NULL);

	printf("worker2 joined\n");
}


int main()
{
	gtthread_t th1, th2;
	void* ret;
	volatile int i=0;

	gtthread_init(1000);

	gtthread_create(&th1, worker, (void*)1);

	for(;;);
}
